<?php
/* Main.PHP
 *  
 * This is the view template
 * 
 * @author lukas/lee
 * 
 */

$list = array(
    anchor('start', 'Home', ''),
    anchor('/drink', 'Drinks', '') .
    '<ul>' .
    '<li>' . anchor('/category', 'Categories', '') . '</li>' .
    '<li>' . anchor('/drink/top', 'Top Rated', '') . '</li>' .
    '<li>' . anchor('/drink/own', 'Own Recipes', '') . '</li>' .
    '</ul>',
    anchor('#', 'Food', ''),
    anchor('#', 'Placeholder', ''),
    anchor('#', 'Contact', ''),
);
$attributes = array(
    'id' => 'navigation',
);
echo doctype('html5');
?>
<html>
    <head>
        <title>Cpt. Cocks Cocktaildreams</title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">        
        <link rel="stylesheet" type="text/css" href="<?php echo base_url('css/main.css'); ?>"/>
        <link rel="stylesheet" media="screen" href="<?php echo base_url('css/bootstrap.css'); ?>">
        <script src="http://code.jquery.com/jquery.js"></script>
        <script src="<?php echo base_url('js/bootstrap.min.js'); ?>"></script>
    </head>
    <body>                  
        <!-- Contains everything else -->
        <div class="row-fluid" id="container">
            <!-- Contains the logo, links, navigation and user info -->
            <div id="header" class="span12">
                <?php 
                //notification on the upper left
                if(FALSE !== $this->session->flashdata('notification')){
                    foreach($this->session->flashdata('notification') as $notification)
                        echo '<span class="notification ' . $notification['type'] . '">' . $notification['message'] . '</span>';
                }
                
                //login information on the upper right
                if (isset($user_id)) {
                    echo '<div id="info_header_right" class="span3 pull-right">';    
                    echo 'User: ' . anchor('/user/details/' . $user_id, $username, '') . '<br>';
                    echo 'Level: ' . anchor('', 'Admin', '') . '<br>';
                    echo anchor('/auth/logout', 'Logout', '');
                    echo '</div>';
                }
                
                //navigation buttons are processed here
                echo '<div class="span12" id="navi-box">';
                echo ul($list, $attributes); 
                echo '</div>';
                ?>
            </div>
            <div id="content" class="span12">
                <h3 id="content_header"><?php echo isset($headline) ? $headline : 'No Headline!'; ?></h3>
                <?php if(isset($toolbar)): ?>
                <div id="toolbar">
                    <?php echo $toolbar; ?>
                </div>
                <?php endif; ?>
                <div id="yield">
                    <?php if (isset($yield)) echo $yield; ?>
                </div>
            </div>
            <!-- Contains the footer, contact info and stuff... -->
            <div id="footer" class="span12">
                <span class="span1 badge badge-info">Help</span>
                <span class="span1 badge badge-info">Contact</span>
                <span class="span1 badge badge-info">Info</span>
                <span class="span1 badge badge-info">Sponsoring</span>
                <span class="span3 pull-right">&copy; Deadbrainz studios 2013-2014</span>
            </div>
        </div>            
    </body>
</html>
